class Person{
    // 使用private修饰的变量在类外部是不可读取的
    private name:string = "lisi";
    public age:number = 20;
    sayName(){
        console.log(this.name);   
    }
    sayAge(){
        console.log(this.age);   
    }
}
var p:Person= new Person();
console.log(p);
console.log(p.age);
p.age = 30;
console.log(p);
p.sayName();
p.sayAge();


